﻿using System;
using System.Collections.Generic;
using Character;
using Manager;
using SEXY;
using UnityEngine;

namespace Studio
{
	// Token: 0x02000493 RID: 1171
	public class OCICharFemale : OCIChar
	{
		// Token: 0x17000303 RID: 771
		// (get) Token: 0x06001D11 RID: 7441 RVA: 0x000B97C4 File Offset: 0x000B79C4
		public ChaControl female
		{
			get
			{
				return this.charInfo;
			}
		}

		// Token: 0x17000304 RID: 772
		// (get) Token: 0x06001D12 RID: 7442 RVA: 0x000B97CC File Offset: 0x000B79CC
		public Female femaleBehaviour
		{
			get
			{
				return this.charInfo.human as Female;
			}
		}

		// Token: 0x06001D13 RID: 7443 RVA: 0x000B97E0 File Offset: 0x000B79E0
		public override void OnDelete()
		{
			base.OnDelete();
			Singleton<Manager.Character>.Instance.DeleteChara(this.female);
		}

		// Token: 0x06001D14 RID: 7444 RVA: 0x000B97F8 File Offset: 0x000B79F8
		public override void LoadAnime(int _group, int _category, int _no, float _normalizedTime = 0f)
		{
			Dictionary<int, Dictionary<int, Info.AnimeLoadInfo>> dictionary = null;
			if (!Singleton<Info>.Instance.dicFemaleAnimeLoadInfo.TryGetValue(_group, out dictionary))
			{
				return;
			}
			Dictionary<int, Info.AnimeLoadInfo> dictionary2 = null;
			if (!dictionary.TryGetValue(_category, out dictionary2))
			{
				return;
			}
			Info.AnimeLoadInfo animeLoadInfo = null;
			if (!dictionary2.TryGetValue(_no, out animeLoadInfo))
			{
				return;
			}
			bool flag = _group == 0 && _category == 0 && _no == 0;
			this.female.LoadAnimation(animeLoadInfo.bundlePath, animeLoadInfo.fileName, !flag);
			this.animatorInfo = new OCIChar.AnimatorInfo(this.female.animBody);
			if (this.animatorInfo.isHeight)
			{
				this.female.SetAnimatorParamFloat(this.animatorInfo.height, this.female.GetShapeBodyValue(0));
			}
			if (_normalizedTime != 0f)
			{
				this.charAnimeCtrl.Play(animeLoadInfo.clip, _normalizedTime);
			}
			else
			{
				this.female.AnimPlay(animeLoadInfo.clip);
			}
			this.optionItemCtrl.LoadAnimeItem(animeLoadInfo, animeLoadInfo.clip, this.female.GetShapeBodyValue(0), base.oiCharInfo.animePattern[0]);
			this.isAnimeMotion = animeLoadInfo.isMotion;
			if (animeLoadInfo.isHAnime)
			{
				if (this.animatorInfo.isBreast)
				{
					this.female.SetAnimatorParamFloat(this.animatorInfo.breast, this.female.GetShapeBodyValue(1));
				}
				if (this.isAnimeMotion && this.animatorInfo.isMotion)
				{
					this.female.SetAnimatorParamFloat(this.animatorInfo.motion, base.oiCharInfo.animePattern[0]);
				}
				if (this.isAnimeMotion && this.animatorInfo.isStroke)
				{
					this.female.SetAnimatorParamFloat(this.animatorInfo.stroke, base.oiCharInfo.animePattern[1]);
				}
				this.charAnimeCtrl.isSync = animeLoadInfo.isBreastLayer;
				if (this.animatorInfo.isBreastLayer)
				{
					this.charAnimeCtrl.animator.SetLayerWeight(this.animatorInfo.breastLayer, (float)((!animeLoadInfo.isBreastLayer) ? 0 : 1));
				}
				this.female.PlayDynamicBoneBust(CharDefine.DynamicBoneKind.BreastL, animeLoadInfo.dynamic[0]);
				this.female.PlayDynamicBoneBust(CharDefine.DynamicBoneKind.BreastR, animeLoadInfo.dynamic[1]);
			}
			else
			{
				this.charAnimeCtrl.isSync = false;
			}
			this.charAnimeCtrl.nameHadh = Animator.StringToHash(animeLoadInfo.clip);
			base.oiCharInfo.animeInfo.Set(_group, _category, _no);
			this.SetNipStand(base.oiCharInfo.nipple);
		}

		// Token: 0x06001D15 RID: 7445 RVA: 0x000B9AA0 File Offset: 0x000B7CA0
		public override void SetTearsLv(float _state)
		{
			base.SetTearsLv(_state);
			this.charInfo.fileStatus.tearsLv = _state;
			this.femaleBehaviour.SetTear(_state, false);
		}

		// Token: 0x06001D16 RID: 7446 RVA: 0x000B9AC8 File Offset: 0x000B7CC8
		public override float GetTearsLv()
		{
			return this.charInfo.fileStatus.tearsLv;
		}

		// Token: 0x06001D17 RID: 7447 RVA: 0x000B9ADC File Offset: 0x000B7CDC
		public override void SetHohoAkaRate(float _value)
		{
			base.SetHohoAkaRate(_value);
			this.charInfo.fileStatus.hohoAkaRate = _value;
			this.femaleBehaviour.SetFlush(_value, false);
		}

		// Token: 0x06001D18 RID: 7448 RVA: 0x000B9B04 File Offset: 0x000B7D04
		public override float GetHohoAkaRate()
		{
			return this.charInfo.fileStatus.hohoAkaRate;
		}

		// Token: 0x06001D19 RID: 7449 RVA: 0x000B9B18 File Offset: 0x000B7D18
		public override void SetSiruFlags(CharDefine.SiruParts _parts, byte _state)
		{
			base.SetSiruFlags(_parts, _state);
			SPERM_POS[] array = new SPERM_POS[]
			{
				SPERM_POS.FACE,
				SPERM_POS.BUST,
				SPERM_POS.CROTCH,
				SPERM_POS.BACK,
				SPERM_POS.HIP
			};
			this.femaleBehaviour.SetSperm(array[(int)_parts], (int)_state, true);
		}

		// Token: 0x06001D1A RID: 7450 RVA: 0x000B9B50 File Offset: 0x000B7D50
		public override byte GetSiruFlags(CharDefine.SiruParts _parts)
		{
			SPERM_POS[] array = new SPERM_POS[]
			{
				SPERM_POS.FACE,
				SPERM_POS.BUST,
				SPERM_POS.CROTCH,
				SPERM_POS.BACK,
				SPERM_POS.HIP
			};
			return (byte)this.femaleBehaviour.GetSpermLv(array[(int)_parts]);
		}

		// Token: 0x06001D1B RID: 7451 RVA: 0x000B9B80 File Offset: 0x000B7D80
		public override void SetTuyaRate(float _value)
		{
			base.SetTuyaRate(_value);
			base.oiCharInfo.skinRate = _value;
			this.femaleBehaviour.SetSkinSmoothAdd(_value);
		}

		// Token: 0x06001D1C RID: 7452 RVA: 0x000B9BA4 File Offset: 0x000B7DA4
		public override void SetNipStand(float _value)
		{
			base.SetNipStand(_value);
			base.oiCharInfo.nipple = _value;
			Female female = this.charInfo.human as Female;
			female.SetNipAdd(_value);
		}

		// Token: 0x06001D1D RID: 7453 RVA: 0x000B9BDC File Offset: 0x000B7DDC
		public override void ChangeChara(string _path)
		{
			base.ChangeChara(_path);
			this.female.UpdateBustSoftnessAndGravity();
			this.optionItemCtrl.height = this.female.GetShapeBodyValue(0);
			this.female.SetAnimatorParamFloat("Height", this.female.GetShapeBodyValue(0));
			if (this.isAnimeMotion)
			{
				this.female.SetAnimatorParamFloat("breast", this.female.GetShapeBodyValue(1));
			}
			for (int i = 0; i < 5; i++)
			{
				this.SetSiruFlags((CharDefine.SiruParts)i, base.oiCharInfo.siru[i]);
			}
			this.SetTuyaRate(base.oiCharInfo.skinRate);
			this.SetHohoAkaRate(this.charInfo.fileStatus.hohoAkaRate);
			this.ChangeFaceOption(base.oiCharInfo.faceOption);
		}

		// Token: 0x06001D1E RID: 7454 RVA: 0x000B9CB4 File Offset: 0x000B7EB4
		public override void SetClothesStateAll(int _state)
		{
			base.SetClothesStateAll(_state);
			this.female.SetClothesStateAll((byte)_state);
		}

		// Token: 0x06001D1F RID: 7455 RVA: 0x000B9CCC File Offset: 0x000B7ECC
		public override void SetClothesState(int _id, byte _state)
		{
			base.SetClothesState(_id, _state);
			this.female.SetClothesState(_id, _state);
		}

		// Token: 0x06001D20 RID: 7456 RVA: 0x000B9CE4 File Offset: 0x000B7EE4
		public override void LoadClothesFile(string _path)
		{
			base.LoadClothesFile(_path);
			this.female.UpdateBustSoftnessAndGravity();
			this.skirtDynamic = AddObjectFemale.GetSkirtDynamic(this.charInfo);
			base.ActiveFK(OIBoneInfo.BoneGroup.Skirt, base.oiCharInfo.activeFK[6], base.oiCharInfo.activeFK[6]);
		}
	}
}
